import request from '@/utils/request'

// api地址
const api = {
  userInfo: 'user/info',
  assets: 'user/asset',
  setting: 'user/setting',
  defaultStore: 'user/defaultStore'
}

// 当前登录的用户信息
export const info = (param, option) => {
  const options = {
    isPrompt: true, //（默认 true 说明：本接口抛出的错误是否提示）
    load: true, //（默认 true 说明：本接口是否提示加载动画）
    ...option
  }
  return request.get(api.userInfo, param, options)
}

// 账户资产
export const assets = (param, option) => {
  return request.get(api.assets, param)
}

// 获取会员设置
export const setting = (param, option) => {
  return request.get(api.setting, param)
}

// 设置会员的默认店铺
export const defaultStore = (storeId) => {
  return request.get(api.defaultStore, { storeId })
}